//package phase4Specification.testing;
//
//
//import java.util.ArrayList;
//
//import dbPhase.hypeerweb.Node;
//import dbPhase.hypeerweb.Parameters;
//import dbPhase.hypeerweb.Visitor;
//import dbPhase.hypeerweb.WebId;
//
//public abstract class BroadcastVisitorzzzz
//    implements Visitor
//{
//    public BroadcastVisitorzzzz() {
//    }
//
//    public void visit(Node node, Parameters parameters) {
//        if (parameters.containsKey(STARTED_KEY)) {
//            operation(node, parameters);
//            broadcastToNeighbors(node, parameters);
//        } else {
//            parameters.set(STARTED_KEY, "");
//            Node node0 = node.getConnectionsContainer().find(node, NODE_0_ID);
//            node0.accept(this, parameters);
//        }
//    }
//
//    protected abstract void operation(Node node, Parameters parameters);
//
//    private void broadcastToNeighbors(Node node, Parameters parameters) {
//        ArrayList<Node> neighborsForBroadcast = node.getConnectionsContainer().getNeighborsForBroadcast(node);
//        for (Node broadcastNeighbor : neighborsForBroadcast) {
//            broadcastNeighbor.accept(this, parameters);
//        }
//    }
//
//    protected static final String STARTED_KEY = "started";
//    protected static final WebId NODE_0_ID = new WebId(0);
//}